/**
 * Copyright (c) 2012, SHX Studio.
 * All rights reserved.
 * rosary226@gmail.com
 * 
 * @author shenqianfeng
 * @date 2012-9-1  
 * @version 1.0   
 */

package com.xxx.sqfengine;

import java.util.ArrayList;

import android.R.integer;
import android.os.Handler;
import android.util.Log;

import com.xxx.sqfengine.util.SQFGLColor4;
import com.xxx.sqfengine.util.SQFGLConstants;

public class SQFGLScene {
	
	private ArrayList<SQFGL3DObject> m3DObjectList = new ArrayList<SQFGL3DObject>();
	
	private SQFGLSceneController mController;

	public SQFGLScene(SQFGLSceneController controller) {
		this.mController = controller;
	}
	
	public void initScene() {
		getInitHandler().post(getInitRunnable());
	}
	
	public void updateScene() {
		getUpdateHandler().post(getUpdateRunnable());
	}

	public Handler getInitHandler() {
		return mController.getInitHandler();
	}
	
	public Handler getUpdateHandler() {
		return mController.getUpdateHandler();
	}
	
	public Runnable getInitRunnable() {
		return mController.getInitRunnable();
	}
	
	public Runnable getUpdateRunnable() {
		return mController.getUpdateRunnable();
	}
	
	public void setBackgroundColor(SQFGLColor4 bgColor) {
		return;
	}
	
	public void addObject(SQFGL3DObject object) {
		if (null == m3DObjectList) {
			return;
		}
		m3DObjectList.add(object);
		return;
	}
	
	public int get3DObjectNum() {
		return m3DObjectList.size();
	}
	
	public SQFGL3DObject get3DObject(int index) {
		return m3DObjectList.get(index);
	}
	
}
